package civaid.datamodel;

import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.jdo.annotations.IdGeneratorStrategy;
import com.google.appengine.api.datastore.Key;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import civaid.datamodel.Civilization.CARD_ID;

@PersistenceCapable
public class CivilizationEvent {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

	@Persistent
	@Element(dependent = "true")
	private Civilization civilization;
    
	@Persistent
	private int points;

	@Persistent
	private int cards;

	@Persistent
	private Date date;
	
	@Persistent
	private Collection<CARD_ID> added;

	@Persistent
	private Collection<CARD_ID> removed;

	public CivilizationEvent() {
		
	}
	
	public Key getKey() {
		return key;
	}
	
	public int getPoints() {
		return points;
	}

	public Civilization getCivilization() {
		return civilization;
	}

	public void setCivilization(Civilization civilization) {
		this.civilization = civilization;
	}

	public void setPoints(int points) {
		this.points = points;
	}

	public int getCards() {
		return cards;
	}

	public void setCards(int cards) {
		this.cards = cards;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Collection<CARD_ID> getAdded() {
		return added;
	}

	public void setAdded(Collection<CARD_ID> added) {
		this.added = added;
	}

	public Collection<CARD_ID> getRemoved() {
		return removed;
	}

	public void setRemoved(Collection<CARD_ID> removed) {
		this.removed = removed;
	}

	public String getIdentification() {
		return date.getTime() + "_" + points + "_" + cards;
	}

}
